#include <stdio.h>

int main()
{
  {
    // 乘法口诀表1
    for (int i = 1; i <= 9; i++)
    {
      for (int j = 1; j <= i; j++)
      {
        printf("%dX%d=%d \t", j, i, i * j); //\t转义字符有对齐的功能
      }
      printf("\n");
    }
  }
  printf("======================================================================\n");
  {
    // 乘法口诀表2
    for (int i = 9; i >= 1; i--)
    {
      for (int j = 1; j <= i; j++)
      {
        printf("%dx%d=%d\t", j, i, i * j);
      }
      printf("\n");
    }
  }
  printf("======================================================================\n");
  {
    // 乘法口诀表3
    for (int i = 1; i <= 9; i++)
    {
      for (int j = 1; j <= 9 - i; j++)
      {
        printf("\t");
      }
      for (int j = 1; j <= i; j++)
      {
        printf("%dx%d=%d\t", j, i, i * j);
      }
      printf("\n");
    }
  }
  printf("======================================================================\n");
  {
    // 乘法口诀表4
    for (int i = 9; i >= 1; i--)
    {
      for (int j = 1; j <= 9 - i; j++)
      {
        printf("\t");
      }
      for (int j = 1; j <= i; j++)
      {
        printf("%dx%d=%d\t", j, i, i * j);
      }
      printf("\n");
    }
  }
  return 0;
}